<template>
<div>
  <el-select v-model="value" v-bind="elProps" @change="change">
    <el-option
      v-for="item in options"
      :key="item.value || item.id"
      :label="item.label || item.name"
      :value="item.value || item.id"
      :disabled="item.disabled"
    />
  </el-select>
</div>
</template>

<script setup>
import { ref,watch } from 'vue' 
const props = defineProps({
    elProps:Object,
    modelValue:[String,Array,Number],
    options:Object,
})
const value = ref('')
watch(()=>props.modelValue,(newval)=>{
value.value = newval
})
value.value = props.modelValue

const emit = defineEmits(['update:modelValue'])
const change = ()=>{
  emit('update:modelValue',value.value)
}
</script>

<style lang='scss' scoped>

</style>